// 公用组件样式提取
export const pubStyles = [
  {
    type: 'el-input-number',
    label: '组件宽度',
    name: 'w',
    required: false,
    placeholder: '',
    value: 320 //默认宽320
  },
  {
    type: 'el-input-number',
    label: '组件高度',
    name: 'h',
    required: false,
    placeholder: '',
    value: 200 //默认高200
  },
  {
    type: 'el-input-number',
    label: '左上倒角',
    name: 'leftTop',
    required: false,
    placeholder: '',
    value: 3 //默认高200
  },
  {
    type: 'el-input-number',
    label: '左下倒角',
    name: 'leftBottom',
    required: false,
    placeholder: '',
    value: 3 //默认高200
  },
  {
    type: 'el-input-number',
    label: '右上倒角',
    name: 'rightTop',
    required: false,
    placeholder: '',
    value: 3 //默认高200
  },
  {
    type: 'el-input-number',
    label: '右下倒角',
    name: 'rightBottom',
    required: false,
    placeholder: '',
    value: 3 //默认高200
  }

  // {
  //     type: 'el-input-number',
  //     label: '组件left',
  //     name: 'x',
  //     required: false,
  //     placeholder: '',
  //     value: '' //默认高200
  // },
  // {
  //     type: 'el-input-number',
  //     label: '组件高度',
  //     name: 'y',
  //     required: false,
  //     placeholder: '',
  //     value: '' //默认高200
  // }
];

// 关联数据集
export const pubDatasetComponentType = {
  type: 'datasetComponentType',
  label: '关联数据集',
  name: 'associatedDatasets',
  required: true,
  placeholder: '',
  value: {}
};

// 关联数据集
export const pubLinkageSettingType = {
  type: 'linkageSettingType',
  label: '联动设置',
  name: 'linkageSetting',
  required: false,
  placeholder: '',
  value: {}
};

// 穿透设置
export const pubPenetrationSettingsType = {
  type: 'penetrationSettingsType',
  label: '穿透设置',
  name: 'penetrationSettings',
  required: false,
  placeholder: '',
  value: {}
};

let arr = [
  '#ff4500',
  '#ff8c00',
  '#ffd700',
  '#90ee90',
  '#00ced1',
  '#1e90ff',
  '#c71585',
  'rgba(255, 69, 0, 0.68)',
  'rgb(255, 120, 0)',
  // 'hsv(51, 100, 98)',
  // 'hsva(120, 40, 94, 0.5)',
  'hsl(181, 100%, 37%)',
  'hsla(209, 100%, 56%, 0.73)',
  '#c7158577'
];

// 是否展示图例
export const pubLegend = [
  {
    type: 'el-select',
    label: '图例显示',
    name: 'legendShow',
    required: true,
    placeholder: '',
    selectOptions: [
      {
        label: '是',
        value: true
      },
      {
        label: '否',
        value: false
      }
    ],
    value: true
  },
  {
    type: 'el-select',
    label: '图例位置',
    name: 'legendPosition',
    required: true,
    placeholder: '',
    selectOptions: [
      {
        label: '顶部',
        value: 'top'
      },
      {
        label: '底部',
        value: 'bottom'
      },
      {
        label: '左边',
        value: 'left'
      },
      {
        label: '右边',
        value: 'right'
      }
    ],
    value: 'top'
  },
  {
    type: 'el-input-number',
    label: '图例字体大小',
    name: 'legendFontSize',
    required: false,
    placeholder: '',
    value: 14 //默认高200
  },
  {
    type: 'el-color-picker',
    label: '图例字体颜色',
    name: 'legendColor',
    placeholder: '',
    value: '#000'
  },
  {
    type: 'el-select',
    secondType: 'colorCheckMore',
    label: '图形配色',
    name: 'chartColorArr',
    multiple: true, //是否可多选
    placeholder: '',
    value: [],
    selectOptions: arr.map((item) => {
      return {
        label: item,
        value: item
      };
    })
  }
];

export const publicChartsStyles = {
  //styles可以是数组,也可以是对象,是对象的时候用于echarts

  //组合图,
  groupList: [
    ...pubStyles,

    {
      type: 'el-select',
      label: '标题位置',
      name: 'titlePosition',
      placeholder: '',
      value: 'left',
      selectOptions: [
        {
          label: '左对齐',
          value: 'left'
        },
        {
          label: '居中对齐',
          value: 'center'
        },
        {
          label: '右对齐',
          value: 'right'
        }
      ]
    },
    {
      type: 'el-color-picker',
      label: '背景颜色',
      name: 'componentBg',
      placeholder: '',
      value: ''
    },
    {
      type: 'el-color-picker', //每一个柱子颜色填充
      label: '标题颜色',
      name: 'echartsTitleColor',
      placeholder: '',
      value: '#000'
    },
    {
      type: 'el-input-number',
      label: '字体大小',
      name: 'echartsTextFontsize',
      required: false,
      placeholder: '',
      value: 18 //默认高200
    }
  ],
  //坐标轴
  axisList: [
    {
      type: 'el-collapse',
      notShowLabel: true,
      label: 'x轴', //x轴
      // name: 'xAxis',
      placeholder: '',
      value: '',
      children: [
        {
          type: 'el-select',
          label: '轴标题',
          name: 'axisTitleShowX',
          placeholder: '',
          value: false,
          selectOptions: [
            {
              label: '显示',
              value: true
            },
            {
              label: '隐藏',
              value: false
            }
          ]
        },
        {
          type: 'el-color-picker',
          label: 'x轴标题颜色',
          name: 'xAxisLabelColor',
          placeholder: '',
          value: ''
        },
        {
          type: 'el-input-number',
          label: 'x轴字体大小',
          name: 'xAxisLabelFontSize',
          required: false,
          placeholder: '',
          value: 14 //默认高200
        },
        {
          type: 'el-slider',
          label: 'x轴字体角度',
          name: 'xAxisLabelRotate',
          required: false,
          placeholder: '',
          value: 0
        }
      ]
    },
    {
      type: 'el-collapse',
      notShowLabel: true,
      label: 'y轴',
      // name: 'yAxis',
      placeholder: '',
      value: '',
      children: [
        {
          type: 'el-select',
          label: '轴标题',
          name: 'axisTitleShowY',
          placeholder: '',
          value: false,
          selectOptions: [
            {
              label: '显示',
              value: true
            },
            {
              label: '隐藏',
              value: false
            }
          ]
        },
        {
          type: 'el-select',
          label: '是否显示y轴',
          name: 'showYAxis',
          placeholder: '',
          value: true,
          selectOptions: [
            {
              label: '显示',
              value: true
            },
            {
              label: '隐藏',
              value: false
            }
          ]
        },
        {
          type: 'el-color-picker',
          label: 'y轴标题颜色',
          name: 'yAxisLabelColor',
          placeholder: '',
          value: ''
        },
        {
          type: 'el-input-number',
          label: 'y轴字体大小',
          name: 'yAxisLabelFontSize',
          required: false,
          placeholder: '',
          value: 14 //默认高200
        },
        {
          type: 'el-slider',
          label: 'y轴字体角度',
          name: 'yAxisLabelRotate',
          required: false,
          placeholder: '',
          value: 0
        }
      ]
    }
  ],
  //系列
  successionList: [],
  //图例
  legendList: [...pubLegend]
};
export const groupList = [
  ...pubStyles,
  {
    type: 'el-select',
    label: '标题位置',
    name: 'titlePosition',
    placeholder: '',
    value: 'left',
    selectOptions: [
      {
        label: '左对齐',
        value: 'left'
      },
      {
        label: '居中对齐',
        value: 'center'
      },
      {
        label: '右对齐',
        value: 'right'
      }
    ]
  },
  {
    type: 'el-color-picker',
    label: '背景颜色',
    name: 'componentBg',
    placeholder: '',
    value: ''
  },
  {
    type: 'el-color-picker', //每一个柱子颜色填充
    label: '标题颜色',
    name: 'echartsTitleColor',
    placeholder: '',
    value: '#000'
  },
  {
    type: 'el-input-number',
    label: '字体大小',
    name: 'echartsTextFontsize',
    required: false,
    placeholder: '',
    value: 18 //默认高200
  }
];

export const axisList= [
  {
    type: 'el-collapse',
    notShowLabel: true,
    label: 'x轴', //x轴
    // name: 'xAxis',
    placeholder: '',
    value: '',
    children: [
      {
        type: 'el-select',
        label: '轴标题',
        name: 'axisTitleShowX',
        placeholder: '',
        value: false,
        selectOptions: [
          {
            label: '显示',
            value: true
          },
          {
            label: '隐藏',
            value: false
          }
        ]
      },
      {
        type: 'el-color-picker',
        label: 'x轴标题颜色',
        name: 'xAxisLabelColor',
        placeholder: '',
        value: ''
      },
      {
        type: 'el-input-number',
        label: 'x轴字体大小',
        name: 'xAxisLabelFontSize',
        required: false,
        placeholder: '',
        value: 14 //默认高200
      },
      {
        type: 'el-slider',
        label: 'x轴字体角度',
        name: 'xAxisLabelRotate',
        required: false,
        placeholder: '',
        value: 0
      }
    ]
  },
  {
    type: 'el-collapse',
    notShowLabel: true,
    label: 'y轴',
    // name: 'yAxis',
    placeholder: '',
    value: '',
    children: [
      {
        type: 'el-select',
        label: '轴标题',
        name: 'axisTitleShowY',
        placeholder: '',
        value: false,
        selectOptions: [
          {
            label: '显示',
            value: true
          },
          {
            label: '隐藏',
            value: false
          }
        ]
      },
      {
        type: 'el-select',
        label: '是否显示y轴',
        name: 'showYAxis',
        placeholder: '',
        value: true,
        selectOptions: [
          {
            label: '显示',
            value: true
          },
          {
            label: '隐藏',
            value: false
          }
        ]
      },
      {
        type: 'el-color-picker',
        label: 'y轴标题颜色',
        name: 'yAxisLabelColor',
        placeholder: '',
        value: ''
      },
      {
        type: 'el-input-number',
        label: 'y轴字体大小',
        name: 'yAxisLabelFontSize',
        required: false,
        placeholder: '',
        value: 14 //默认高200
      },
      {
        type: 'el-slider',
        label: 'y轴字体角度',
        name: 'yAxisLabelRotate',
        required: false,
        placeholder: '',
        value: 0
      }
    ]
  }
]
export const successionList = [];